// var cityData = require('../../../utils/city.js');

// page/one/index.js
Page({
  data:{
    content: [],
    // nv: [],
    // px: [],
    qyopen:false,
    qyshow:false,
    cityleft: cityData.getCity(),
    citycenter: {},
    cityright: {},
    select1: '',
    select2:'',
    shownavindex:''
  },
  onLoad: function(){
    this.setData({
      nv:['衣服','裤子','内衣','服饰','衣服','裤子','内衣','服饰','衣服','裤子','内衣','服饰'],
      px:['默认排序','离我最近','价格最低','价格最高']
    })
  },
  listqy: function(e){
    if(this.data.qyopen){
      this.setData({
        qyopen:false,
        qyshow:false,
        shownavindex: 0
      })
    }else{
      this.setData({
        qyopen:true,
        qyshow:false,
        shownavindex:e.currentTarget.dataset.nav
      })
    }
    
  },
  selectleft: function(e){
    this.setData({
      cityright:{},
      citycenter:this.data.cityleft[e.currentTarget.dataset.city],
      select1: e.target.dataset.city,
      select2:''
    });
  },
    //-------------------私有方法-----------------
  analysis: function (data) {
    for (var i = 0; i < data.length; i++) {
      var obj1 = data[i]
      for (var j = 0; j < obj1.OrderItems.length; j++) {
        var obj2 = obj1.OrderItems[j]
        obj2.AttributesXml = obj2.AttributesXml.replace(/<.+?>/g, "");
      }
    }
    return data
  },

})